#ifndef HARDWAREVIEW_H
#define HARDWAREVIEW_H

#include "rightwidget.h"

class HardwareView : public RightWidget
{
    Q_OBJECT
public:
    HardwareView(const QString& path);
    virtual ~HardwareView();

public:
    virtual bool init();
    virtual bool updateParm();

protected:
    qint32 getCanBaudrateIndex(const QString& baudrate);

    qint32 getComBaudrateIndex(const QString& baudrate);
    qint32 getComDatabitsIndex(const QString& databits);
    qint32 getComStopbitsIndex(const QString& stopbits);
    qint32 getComCheckbitsIndex(const QString& checkbits);

    qint32 getSwitchTypeIndex(const QString& type);

protected slots:
    void comboBoxIndexChanged(int);
    void lineEditTextChanged(const QString&);

private:
    QLineEdit* m_leMac1;
    QLineEdit* m_leIp1;
    QLineEdit* m_leMask1;

    QLineEdit* m_leMac2;
    QLineEdit* m_leIp2;
    QLineEdit* m_leMask2;

    QComboBox* m_cbCan1Baudrate;
    QComboBox* m_cbCan2Baudrate;

    QLineEdit* m_leSwitchAddr;
    QComboBox* m_cbSwitchType;

    QComboBox* m_cbCom1Baudrate;
    QComboBox* m_cbCom1StartBits;
    QComboBox* m_cbCom1DataBits;
    QComboBox* m_cbCom1StopBits;
    QComboBox* m_cbCom1CheckBits;

    QComboBox* m_cbCom2Baudrate;
    QComboBox* m_cbCom2StartBits;
    QComboBox* m_cbCom2DataBits;
    QComboBox* m_cbCom2StopBits;
    QComboBox* m_cbCom2CheckBits;

    QComboBox* m_cbCom3Baudrate;
    QComboBox* m_cbCom3StartBits;
    QComboBox* m_cbCom3DataBits;
    QComboBox* m_cbCom3StopBits;
    QComboBox* m_cbCom3CheckBits;

    QComboBox* m_cbCom4Baudrate;
    QComboBox* m_cbCom4StartBits;
    QComboBox* m_cbCom4DataBits;
    QComboBox* m_cbCom4StopBits;
    QComboBox* m_cbCom4CheckBits;

};

#endif // HARDWAREVIEW_H
